<?php
namespace app\manger\validate\wechat;

use think\Validate;

/**
 * 图文消息验证规则
 * @package app\manger\validate\wechat
 */
class MsgPics extends Validate
{
    protected $rule = [
        'genre' => 'require',
        'keyword' => 'require|max:60',
        'title' => 'require|max:192',
        'image' => 'require|max:768',
        'url' => 'max:1536',
        'sort' => 'require|number',
        'intro' => 'max:3072',
    ];

    protected $message = [
        'genre.require' => '类型不能为空!',
        'keyword.unique' => '关键字已经存在!',
        'keyword.require' => '关键字不能为空!',
        'keyword.max' => '关键字不能大于20个字符!',
        'title.require' => '标题不能为空!',
        'title.max' => '标题不能大于64个字符!',
        'image.require' => '封面图不能为空!',
        'image.max' => '封面图路径不能超过256个字符!',
        'url.max' => '链接地址不能超过512个字符!',
        'sort.require' => '排序不能为空!',
        'sort.number' => '排序只能为数字!',
        'intro.max' => '内容不能大于1024个字符!',
    ];
}